import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';

import 'transition.dart';

extension Transition on Widget {
  Page<dynamic> opacity(BuildContext context, GoRouterState state) {
    return opacityPage(key: state.pageKey, child: this);
  }

  Page<dynamic> dismissible(BuildContext context, GoRouterState state) {
    return dismissiblePage(key: state.pageKey, child: this);
  }

  Page<dynamic> opacityReverse(BuildContext context, GoRouterState state) {
    return opacityReversePage(key: state.pageKey, child: this);
  }
}
